Skip to content

fix(gatsby-transformer-react-docgen): support schema rebuilding #20095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

vladar
Copy link
Contributor

@vladar vladar commented Dec 12, 2019

Description

Schema rebuilding introduced in #19092 requires fresh instances of GraphQL types on each rebuild. So plugins using setFieldsOnGraphQLNodeType or createSchemaCustomization APIs with original graphql.js types must provide new type instances on each API call.

This is an unfortunate restriction caused by graphql-compose design which mutates types under the hood. Therefore we can not reliably re-use old types for a new schema.

This issue doesn't apply to plugins using SDL or type builders to define GraphQL types as we produce fresh type instances for them automatically.

Related Issues

Fixes #20043

@vladar vladar requested a review from a team as a code owner December 12, 2019 10:52
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get fix in!

@pieh pieh merged commit 2c83f09 into master Dec 12, 2019
@pieh pieh deleted the vladar/gh-20043 branch December 12, 2019 13:50
@vladar
Copy link
Contributor Author

vladar commented Dec 12, 2019

Published in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gatsby-transformer-react-docgen fails on hot reloads
2 participants